<?php
// parameters
$aValues = (isset($_POST['v'])?json_decode($_POST['v'], true):array());
$sKey = (isset($_POST['k'])?$_POST['k']:'');
$sDataStore = $_GET['ds'];
if(!$sKey) {
    print $GLOBALS['_ObjectResponse']->getErrorResponse(103, "Param 'k' is missing");
    exit(1);
}


// enqueue
$oDuilie = new PHPDuilie("simaqian_$sDataStore_cmds");
$oDuilie->addQServer($GLOBALS['MemcacheQServer']['host']
    , $GLOBALS['MemcacheQServer']['port']);
$oDuilie->addDBServer($GLOBALS['MemcacheDBServer']['host']
    , $GLOBALS['MemcacheDBServer']['port']);
$aCmd = array(
    "cmd"=>"replace",
    "key"=>$sKey,
    "values"=>$aValues
);
$oDuilie->enqueue($aCmd);


// response
print $GLOBALS['_ObjectResponse']->getResponse(array());

?>